package com.easyexcel.usr.validate;

import javax.validation.Validation;
import javax.validation.Validator;

/**
 * @Package: com.easyexcel.usr.validate
 * @ClassName: HibernateValidator
 * @Author: shuaijun Wang
 * @CreateTime: 2020/11/4 14:04
 * @Description:
 */
public class HibernateValidator {
    private static final Validator validator = Validation.byProvider( org.hibernate.validator.HibernateValidator.class )
            .configure()
            .addProperty( "hibernate.validator.fail_fast", "true" )
            .buildValidatorFactory().getValidator();

    private HibernateValidator() {

    }

    public static Validator getValidator() {
        return validator;
    }
}
